public class GirlFriendTest {
    public static void main(String[] args) {
        GirlFriend[] gf = new GirlFriend[4];
        GirlFriend g1 = new GirlFriend("zhangsan",12,"女","跳舞");
        GirlFriend g2 = new GirlFriend("lisi",13,"女","唱歌");
        GirlFriend g3 = new GirlFriend("huihui",14,"女","卖萌");
        GirlFriend g4 = new GirlFriend("lai",15,"女","睡觉");
        gf[0] = g1;
        gf[1] = g2;
        gf[2] = g3;
        gf[3] = g4;

        int sum = 0;
        for (int i = 0; i < gf.length; i++) {
            sum+=gf[i].getAge() ;
        }
        int avg = sum/gf.length;
        int count = 0;
        for (int i = 0; i < gf.length; i++) {
            if(gf[i].getAge()<avg){
                count++;
                System.out.println(gf[i].getName()+", "+gf[i].getAge()+", "+gf[i].getGender()+", "+gf[i].getHobby());
            }
        }
        System.out.println(count);
    }
}
